<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        //当前脚本严格模式
         "use strict"
           { 
            console.log(hello)
            var hello
            window.aa='aa'
            console.log(aa)
        
        const obj={a:'a'};
        obj.a='b'
        console.log(obj)
    }
    // 改变不可写入属性的值
    var obj1 = {};
        Object.defineProperty(obj1, "x", { value: 42, writable: false });
        obj1.x = 9; // 抛出 TypeError 错误
        
        // 不能创建全局变量
        mistypedVaraible = 17;//报错
    </script>
    <script>
        console.log('脚本2')
         mistypedVaraible = 17;//ok
         console.log(mistypedVaraible)

         var obj1 = {};
Object.defineProperty(obj1, "x", { value: 42, writable: false });
obj1.x = 9; // 不报错
    </script>

</body>
</html>